package itheima.Controller;

import itheima.common.R;
import itheima.entity.Orders;
import itheima.service.OrderService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author shkstart
 * @create 2022-09-23-12:09
 */
@Slf4j
@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @PostMapping("/submit")
    public R<String> submit(@RequestBody Orders orders){
        log.info("用户下单：",orders);
        orderService.submit(orders);
        return R.success("下单成功");
    }
}
